home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_069 / sb / sbscreen.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  4KB  |  109 lines

  1. /* include not needed for Aztec C using provided makefile */
  2. #include "sb:sb.h"
  3. extern int level;
  4. extern void PrScreen2(); 
  5.  
  6. void PrScreen(string, screen) char *string; struct Screen *screen;
  7. {
  8. static struct StructData structdata[] = {
  9.      { " NextScreen",   "struct Screen *",     5, PTRSIZE    },
  10.      { " FirstWindow",  "struct Window *",     5, PTRSIZE    },
  11.      { "-LeftEdge",     "SHORT",               2, INTSIZE    },
  12.      { "-TopEdge",      "SHORT",               2, INTSIZE    },
  13.      { "-Width",        "SHORT",               2, INTSIZE    },
  14.      { "-Height",       "SHORT",               2, INTSIZE    },
  15.      { "-MouseY",       "SHORT",               2, INTSIZE    },
  16.      { "-MouseX",       "SHORT",               2, INTSIZE    },
  17.      { " Flags",        "USHORT",             12, INTSIZE    },
  18.      { " Title",        "UBYTE *",             4, PTRSIZE    },
  19.      { " DefaultTitle", "UBYTE *",             4, PTRSIZE    },
  20.      { "-BarHeight",    "BYTE",                3, BYTESIZE   },
  21.      { "-BarVBorder",   "BYTE",                3, BYTESIZE   },
  22.      { "-BarHBorder",   "BYTE",                3, BYTESIZE   },
  23.      { "-MenuVBorder",  "BYTE",                3, BYTESIZE   },
  24.      { "-MenuHBorder",  "BYTE",                3, BYTESIZE   }
  25.   };
  26. static char *flagnames[8] = {
  27.     "WBENCHSCREEN",    "CUSTOMSCREEN",  NULL,             NULL,
  28.     "SHOWTITLE",       "BEEPING",       "CUSTOMBITMAP",   NULL
  29.   };
  30. int sum, choice = -1;
  31. ULONG bits;
  32.   level++;
  33.   while (choice) {
  34.   sum = SetOptionText(string, structdata,
  35.                       (APTR)screen, DATASIZE, 0);
  36.   switch (choice = GetChoice(MAXGADG + 1)) {
  37.     case 1:
  38.       if (screen->NextScreen)
  39.         PrScreen("The next screen in Intuition's list", screen->NextScreen);
  40.       break;
  41.     case 2:
  42.       if (screen->FirstWindow)
  43.         PrWindow("The screen's first window", screen->FirstWindow);
  44.       break;
  45.     case 9:
  46.       if ((bits = screen->Flags) & 2)
  47.         bits ^= 1;
  48.       FlagPrint("The screen's flags", flagnames, bits);
  49.       break;
  50.     case 10:
  51.       PrString("The Screen's Title", screen->Title);
  52.       break;
  53.     case 11:
  54.       PrString("The Screen's Default Title", screen->DefaultTitle);
  55.       break;
  56.     case MOREGADG:
  57.       PrScreen2("Screen members (page 2)", screen, sum);
  58.       break;
  59.     }
  60.   }
  61.   level--;
  62. }
  63.  
  64.  
  65. void PrScreen2(string, screen, offset)
  66. char *string; struct Screen *screen; int offset;
  67. {
  68. static struct StructData structdata[] = {
  69.      { "-WBorTop",      "BYTE",                 3, BYTESIZE      },
  70.      { "-WBorLeft",     "BYTE",                 3, BYTESIZE      },
  71.      { "-WBorLeft",     "BYTE",                 3, BYTESIZE      },
  72.      { "-WBorBottom",   "BYTE",                 3, INTSIZE       },
  73.      { " Font",         "struct TextAttr *",    5, PTRSIZE       },
  74.      { "(ViewPort",     "struct ViewPort)",     0, SZ(ViewPort)  },
  75.      { " RastPort",     "struct RastPort ",     0, SZ(RastPort)  },
  76.      { " BitMap",       "struct BitMap",        0, SZ(BitMap)    },
  77.      { "(LayerInfo",    "struct Layer_Info)",   0, SZ(Layer_Info)},
  78.      { " FirstGadget",  "struct Gadget *",      5, PTRSIZE       },
  79.      { "-DetailPen",    "UBYTE",               13, BYTESIZE      },
  80.      { "-BlockPen",     "UBYTE",               13, BYTESIZE      },
  81.      { "-SaveColor0",   "USHORT",              12, INTSIZE       },
  82.      { "(BarLayer",     "struct Layer *)",      5, PTRSIZE       },
  83.      { "(ExtData",      "UBYTE *)",             5, PTRSIZE       },
  84.      { "(UserData",     "UBYTE *)",             5, PTRSIZE       },
  85.   };
  86. int sum, choice = -1;
  87.   level++;
  88.   while (choice) {
  89.     sum = SetOptionText(string, structdata, (APTR)screen, DATASIZE, offset);
  90.     switch (choice = GetChoice(DATASIZE)) {
  91.       case 5:
  92.         if (screen->Font)
  93.           PrTextAttr("Structure TextAttr",screen->Font);
  94.         break;
  95.       case 7:
  96.         PrRastPort("The screen's RastPort", &screen->RastPort);
  97.         break;
  98.       case 8:
  99.         PrBitMap("The screen's BitMap", &screen->BitMap);
  100.         break;
  101.       case 10:
  102.         if (screen->FirstGadget)
  103.           PrGadget("The screen's first gadget", screen->FirstGadget);
  104.         break;
  105.     }
  106.   }
  107.   level--;
  108. }
  109.